Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Dynamic subgraph property doc #17585

Merged
merged 20 commits into from
Feb 20, 2020
Merged

Conversation

samskalicky
Copy link
Contributor

@samskalicky samskalicky commented Feb 13, 2020

Description

Add a brief tutorial doc on Custom partitioning tutorial and example for the feature implemented in #15969. This PR addresses two of the items in #17532

  • Adds an example using Gluon to partition a model
  • Adds fixes to custom operator support for the backward pass of subgraphOps
  • changes int* and size to vector for ids in acceptSubgraph API

This PR is not

  • Updating docs on the MXNet website on extending MXNet
  • Consolidating custom extension related docs on the website

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Renamed backend_args to backend_opts for the hybridize API to disambiguate from model args (ie. params) since it contains options that are passed to the backend.
  • Moved GPU customOp tests and split tests into diff files for CPU and GPU
    • CPU tests are in unittests/test_extensions.py for test_custom_op (GeMM) and test_subgraph (exp, log)
    • GPU tests are in gpu/test_extensions_gpu.py for test_custom_op_gpu (ReLU)

@samskalicky
Copy link
Contributor Author

@mxnet-label-bot add [pr-awaiting-review]

@lanking520 lanking520 added the pr-awaiting-review PR is waiting for code review label Feb 17, 2020
@samskalicky samskalicky changed the title [WIP] Dynamic subgraph property doc Dynamic subgraph property doc Feb 18, 2020
example/extensions/lib_subgraph/README.md Outdated Show resolved Hide resolved
example/extensions/lib_subgraph/README.md Outdated Show resolved Hide resolved
example/extensions/lib_subgraph/README.md Show resolved Hide resolved
example/extensions/lib_subgraph/README.md Show resolved Hide resolved
src/c_api/c_api.cc Outdated Show resolved Hide resolved
example/extensions/lib_subgraph/README.md Show resolved Hide resolved
example/extensions/lib_subgraph/README.md Outdated Show resolved Hide resolved
@samskalicky
Copy link
Contributor Author

samskalicky commented Feb 18, 2020

Thanks @mseth10 and @rondogency for the suggestions
@aaronmarkham any thoughts on the README.md?
@eric-haibin-lin does this help with the docs you were requesting on the other PRs?
@leezu I remember you had comments, but the doc ended up being much more high level than what we had discussed before. Will you review and let me know if you have new suggestions?

Copy link
Contributor

@mseth10 mseth10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding a descriptive tutorial.

Copy link
Contributor

@guanxinq guanxinq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for adding the tutorial and tests.

Copy link
Contributor

@apeforest apeforest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. I have left a few comments.

@samskalicky
Copy link
Contributor Author

Thanks @apeforest! I made your suggested changes and asked a few clarifying questions

Copy link
Contributor

@rondogency rondogency left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution

Copy link
Contributor

@apeforest apeforest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 🐑 it!

@apeforest apeforest merged commit 4668fbd into apache:master Feb 20, 2020
anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request May 29, 2020
* initial commit

* fixed title header, removed GeMM reference

* added example for gluon partitioning, fixed subgraphOp gradient

* added comments

* cleaned up code, added more explanations to doc

* fixed code block

* fixed docs, changed argument to backend_opts and added comments

* added Gluon test for custom subgraph library unittests

* moved gpu custom operator tests to different file

* fixed stateful op registration context support

* unlinked test_operator_gpu.py with test_extensions_gpu.py

* removed cpu context check since its in gpu folder now

* fixed context

* fixed whitespace

* changed acceptSubgraph API to use vector of bool

* addressed Lin's comments

* fixed whitespace

* changed acceptSubgraph to reviewSubgraph

* retrigger CI
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants